<template>
	<view>
		<view class="cu-bar bg-cyan search">
			<view class="search-form radius">
				<text class="cuIcon-search"></text>
				<input type="text" v-model="s_name" placeholder="搜索图片、文章、视频" confirm-type="search"></input>
			</view>
			<view class="action">
				<button class="cu-btn bg-green shadow-blur round"  @click="searchBack">搜索</button>
			</view>
		</view>
		<view class="cu-card dynamic">
			<view class="cu-item shadow" v-for=" item in backList " :key="item.id">
				<view class="m-date">
					<text class="cuIcon-titles text-orange "></text>{{item.addtime}}
				</view>
				<view class="text-content">
					{{item.content}}
				</view>
				<view class="cu-list menu-avatar comment solids-top">
					<view class="cu-item">
						<view class="content">
							<view class="bg-grey padding-sm radius margin-top-sm  text-sm">
								<view class="flex">
									<view>管理员：</view>
									<view class="flex-sub">{{item.reply}}</view>
								</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				backList: "",
				page: 1,
				s_name: ""
			}
		},
		methods: {
			searchBack() {
				uni.request({
					// url:'http://47.94.164.187:9001/api/content/list/',
					url: 'http://127.0.0.1:9001/api/back/my?page=' + this.page + '&s_name=' + this.s_name,
					method: 'GET',
					header: {
						token: uni.getStorageSync('token')
					},
					success: (res) => {
						console.log(res)
						this.backList = res.data.data.records
					}
				});
			}
		},
		onLoad() {
			uni.request({
				// url:'http://47.94.164.187:9001/api/content/list/',
				url: 'http://127.0.0.1:9001/api/back/my?page=' + this.page + '&s_name=' + this.s_name,
				method: 'GET',
				header: {
					token: uni.getStorageSync('token')
				},
				success: (res) => {
					console.log(res)
					this.backList = res.data.data.records
				}
			});
		}
	}
</script>

<style scoped>
	.m-date {
		padding: 20rpx;
	}
</style>
